﻿using System;

namespace NewInCsharp8
{
    class Program
    {
        static void Main(string[] args)
        {
            //??操作符
            string s=null;
            s??= "hello world";
            Console.WriteLine(s);
            //接口当中定义方法
            ((ILogger)new Logger()).Log("我是接口中的默认打印方法奥");
            //switch
            int cardNumber = 13;
            string cardName = cardNumber switch // assuming cardNumber is an int
            {
                13 => "King",
                12 => "Queen",
                11 => "Jack",
                _ => "Pip card" // equivalent to •default•
            };
            Console.WriteLine(cardName);

        }
    }
}
